import cv2 as cv
import numpy as np

# 读取图像
img = cv.imread('E://text.jpg',0)
rows,cols = img.shape

# 计算旋转中心
rotatedCenter = (cols/2,rows/2)
#生成旋转矩阵
M = cv.getRotationMatrix2D(rotatedCenter, 67, 1)
print(M)
dst = cv.warpAffine(img, M, (cols,rows))

cv.imshow('img',img)
cv.imshow('dst',dst)
cv.waitKey(0)
cv.destroyAllWindows()